class Shard
	#insert method, adds a Dict2 struct to values at set position
	def insert(pos=-1,*args)
		if args.length==@@elements.length
			@values.insert(pos,@Dict2.new(*args))
		elsif args.length<@@elements.length
			raise "Not enough arguments to fill new Dict2 Struct. #{@@elements.length} required."
		else
			raise "Too many arguments supplied to fill new Dict2 Struct. #{@@elements.length} required."
		end

		update
	end

	#deletes an element from the values array based on type parameter
	def delete(type,val=nil,index=0,endnum=-1)
		if type
			@@pntr=@@elements.index(type.to_sym)
			@values[index..endnum].each{|e|
				if e[@@pntr]==val
					@values.delete(e)
				end
			}
		elsif type==false
			if val!=nil
				index,endnum=val,index
			end
			[index..endnum].to_a.each{|i| @values.delete(i)}
		else
			raise TypeError("No type supplied")
		end

		update
	end
end